1. Field of the Invention
This invention relates generally to computer systems, and more particularly to methods and apparatuses for more efficiently partitioning and formatting a storage media of a computer drive.
2. Description of the Related Art
In recent years, computer hardware and software companies have been designing more user friendly systems that allow users to custom configure and modify their systems in view of their particular needs. For instance, users are easily able to add host adapters which provide a computer with an increased level of expansion and customization. As the need for more storage space arises, users typically add additional storage devices (e.g., hard drives and removable drives). Although sophisticated computer users are typically familiar with many of the process steps required to prepare a new drive, a large majority of casual computer users are unaware of the importance of diligently following each step that is required to prepare a new drive.
By way of example, in a Microsoft Windows(trademark) operating system (Microsoft Corp., Redmond Wash.) environment, if a user desires to partition the drive into several logical partitions, the user must first partition the drive and then follow-up with a formatting operation. To better describe the drive preparation process, reference is made to FIG. 1, which pictorially illustrates the steps required to complete a successful preparation. Initially, the physical drive 102 is identified by the user. The identification generally requires that the user select the correct drive to prepare from those connected to a system. Although this is a very simple step, the selection of the wrong drive could be catastrophic if important user data is forever lost. Now, the physical drive is partitioned 103 into a user selected number of logical partitions.
In this example, the user selected to partition the physical drive into three partitions. Upon completing the partitioning 103, the computer must be shut down and restarted in order to reboot 104 the system. When the computer is restarted, the operating system (OS) will scan the drive and then must ascertain in what step of the preparation process it is at currently. Once it is determined that the OS is being restarted after a xe2x80x9cfirst reboot,xe2x80x9d the preparation process continues to a formatting 105 operations.
However, if a casual computer user erroneously believes that the preparation has come to a successful conclusion after the first reboot, the user may mistakenly remove the drive that is currently being prepared. If this were to happen, when the computer was restarted after the first reboot, the formatting 105 may move to format the next drive that may be connected to the system. In such a case, important data and applications stored on the next drive may be irreparably lost after the formatting is performed. In some cases, if the drive being prepared is removed after shut down and before the restart of the first reboot, the system may also experience a routine error and the logic of preparing the drive will be broken.
On the other hand, assuming that the user is sophisticated enough to know that the formatting 105 follows the first reboot 104, the user would have to again reboot 106 after the formatting. During the formatting 105, the OS assigns drive letters (i.e., C:, D:, and E:) to the partitioned drive. Upon reboot 106, the application running the preparation must determine if the reboot is the first or second reboot. When it determines that it is the second reboot, the OS will scan the drive and will proceed to assign a drive control block (DCB) to each partition of the formatted drive. An application can now enable data to be stored in selected partitions of the drive.
Because the preparation of a drive requires two separate reboots, the logical sequence of partitioning followed by a formatting is broken. That is, upon restarting the computer, the application driving the preparation is required to go through more logical tests to ascertain what stage it is in before proceeding to the next stage in the drive preparation. As described above, this break in logic can cause problems if the computer""s physical configuration is changed between reboots. Not only is it a confusing process for the non-sophisticated computer user, it is also time consuming. As the operating systems become more complex, the rebooting process has also been increasing from several seconds to one or more minutes. As such, busy computer users typically offload the drive preparation tasks to more sophisticated computer support personnel to avoid dealing with reboots and other possible errors.
In view of the foregoing, there is a need for a drive preparation method that eliminates the requirement to sequentially reboot the computer system.
Broadly speaking, the present invention fills these needs by providing a method and computer readable media having program instructions for preparing a storage media of a drive. The preparation method is designed to enable partitioning and formatting the storage media without having to reboot the computer system that is performing the preparation. It should be appreciated that the present invention can be implemented in numerous ways, including as a process, an apparatus, a system, a device, a method, or a computer readable medium. Several inventive embodiments of the present invention are described below.
In one embodiment, a method for preparing a storage media is disclosed. The method includes partitioning a selected storage media into two or more partitions. Once partitioned, a kernel mode driver interface is called in order to create a logical device control block for each of the two or more partitions. The method then follows to formatting each of the two or more partitions. The drive preparation is configured to be performed without having to reboot the computer system driving the preparation after the partitioning or after the formatting. The user preparing the storage media can therefore immediately begin using and saving data to the newly prepared drive.
The creating of the logical device control blocks, in this embodiment, includes scanning partition tables of the storage media and identifying partitions of the storage media that have not been previously formatted. The method then follows to associating the logical device control block with physical device control block information of the identified partitions that have not been previously formatted and then assigning a drive letter to each of the partitions. The assigned drive letters are then associated with the physical device control block information of the partitions that have not been previously formatted. The method then follows to instruct an operating system of a computer that is preparing the selected storage media to update information regarding the created logical device control blocks.
In another embodiment, a method for partitioning and formatting storage media of a hard disk drive or removable disk drive is disclosed. The method includes a plurality of operations that are each called by a drive preparation application. The operations of the method include partitioning the storage media into a plurality of partitions. The method then follows to creating a logical device control block for each of the plurality of partitions after the partitioning is complete. Once the logical device control blocks are created, the method follows to formatting each of the plurality of partitions. The partitioning and formatting are performed on-the-fly without cycling through complete reboots after the partitioning and the formatting.
In yet a further embodiment, a computer readable media having program instructions for partitioning and formatting storage media of a hard disk drive or removable disk drive is disclosed. The program instructions include a plurality of operations that are each called by a drive preparation application. The operations of the computer readable media include program instructions for partitioning the storage media into a plurality of partitions and program instructions for creating a logical device control block for each of the plurality of partitions after the partitioning is complete. The computer readable media further includes program instructions for formatting each of the plurality of partitions. The partitioning and formatting are performed on-the-fly without cycling through complete reboots after the partitioning and the formatting.
Other aspects and advantages of the invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.